package com.wyfx.blockchain.common.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author johnson liu
 * @Description 封装前端消息实体类
 * @Date 2020/7/27 17:15
 */
@ApiModel
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@NoArgsConstructor
public class MyResponseEntity<T> {
    /**
     * 请求结果状态码
     */
    @ApiModelProperty(value = "请求结果状态码")
    private Integer code;

    /**
     * 提示信息
     */
    @ApiModelProperty(value = "提示信息")
    private String message;

    /**
     * 返回的数据
     */
    @ApiModelProperty(value = "返回的数据")
    private T data;

    public MyResponseEntity(Integer code) {
        this.code = code;
    }

    public MyResponseEntity(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public MyResponseEntity(Integer code, T data) {
        this.code = code;
        this.data = data;
    }

    public MyResponseEntity(Integer code,String message,T data) {
        this.code = code;
        this.data = data;
        this.message = message;
    }


    public MyResponseEntity( T data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }


}
